//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.lyyzoo.data.dao;

import com.lyyzoo.data.domain.Page;
import com.lyyzoo.data.entity.AbstractEntity;
import com.lyyzoo.data.jdbc.JdbcTemplateSupport;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;

public class BaseDao<T extends AbstractEntity<Long>> extends SimpleDao<T, Long> {
    @Autowired
    protected JdbcTemplateSupport jdbcTemplateSupport;

    public BaseDao() {
    }

    public List<T> findBySql(String sql) {
        return this.jdbcTemplateSupport.find(sql, this.entityClass);
    }

    public List<T> findBySql(String sql, Map<String, ?> params) {
        return this.jdbcTemplateSupport.find(sql, this.entityClass, params);
    }

    public List<T> findBySql(String sql, Object... params) {
        return this.jdbcTemplateSupport.find(sql, this.entityClass, params);
    }

    public List<T> findBySql(String sql, int pageSize) {
        return this.jdbcTemplateSupport.find(sql, this.entityClass, pageSize);
    }

    public List<T> findBySql(String sql, int pageSize, Map<String, ?> params) {
        return this.jdbcTemplateSupport.find(sql, this.entityClass, pageSize, params);
    }

    public <E> List<E> findBySql(String sql, Class<E> entityClass) {
        return this.jdbcTemplateSupport.find(sql, entityClass);
    }

    public <E> List<E> findBySql(String sql, Class<E> entityClass, Map<String, ?> params) {
        return this.jdbcTemplateSupport.find(sql, entityClass, params);
    }

    public <E> List<E> findBySql(String sql, Class<E> entityClass, Object... params) {
        return this.jdbcTemplateSupport.find(sql, entityClass, params);
    }

    public <E> List<E> findBySql(String sql, Class<E> entityClass, int pageSize) {
        return this.jdbcTemplateSupport.find(sql, entityClass, pageSize);
    }

    public <E> List<E> findBySql(String sql, Class<E> entityClass, int pageSize, Map<String, ?> params) {
        return this.jdbcTemplateSupport.find(sql, entityClass, pageSize, params);
    }

    public <E> List<E> findBySql(String sql, Class<E> entityClass, int pageSize, Object... params) {
        return this.jdbcTemplateSupport.find(sql, entityClass, new Object[]{pageSize, params});
    }

    public Page<T> pageBySql(String sql, int pageNumber, int pageSize) {
        return this.jdbcTemplateSupport.page(sql, this.entityClass, pageNumber, pageSize);
    }

    public Page<T> pageBySql(String sql, int pageNumber, int pageSize, Map<String, ?> params) {
        return this.jdbcTemplateSupport.page(sql, this.entityClass, pageNumber, pageSize, params);
    }

    public Page<T> pageBySql(String sql, int pageNumber, int pageSize, Object... params) {
        return this.jdbcTemplateSupport.page(sql, this.entityClass, pageNumber, pageSize, params);
    }

    public <E> Page<E> pageBySql(String sql, Class<E> entityClass, int pageNumber, int pageSize) {
        return this.jdbcTemplateSupport.page(sql, entityClass, pageNumber, pageSize);
    }

    public <E> Page<E> pageBySql(String sql, Class<E> entityClass, int pageNumber, int pageSize, Map<String, ?> params) {
        return this.jdbcTemplateSupport.page(sql, entityClass, pageNumber, pageSize, params);
    }

    public <E> Page<E> pageBySql(String sql, Class<E> entityClass, int pageNumber, int pageSize, Object... params) {
        return this.jdbcTemplateSupport.page(sql, entityClass, pageNumber, pageSize, params);
    }

    public Integer getCountBySql(String sql) {
        return this.jdbcTemplateSupport.queryForCount(sql);
    }

    public Integer getCountBySql(String sql, Map<String, ?> params) {
        return this.jdbcTemplateSupport.queryForCount(sql, params);
    }

    public Integer getCountBySql(String sql, Object... params) {
        return this.jdbcTemplateSupport.queryForCount(sql, params);
    }
}
